﻿Imports System
Imports System.Collections.ObjectModel
Imports System.Workflow.ComponentModel
Imports System.Workflow.ComponentModel.Design

Namespace System.Workflow.Activities
    <ActivityDesignerTheme(GetType(EventHandlingScopeActivityDesignerTheme))> _
    Friend NotInheritable Class EventHandlingScopeDesigner
        Inherits SequentialActivityDesigner
        ' Methods
        Public Overrides Function CanInsertActivities(ByVal insertLocation As HitTestInfo, ByVal activitiesToInsert As ReadOnlyCollection([Of] Activity)) As Boolean
            Dim num As Integer = 0
            Dim activity As Activity
            For Each activity In DirectCast(MyBase.Activity, EventHandlingScopeActivity).Activities
                If (Not Helpers.IsFrameworkActivity(activity) AndAlso Not TypeOf activity Is EventHandlersActivity) Then
                    num += 1
                End If
            Next
            If (num > 0) Then
                Return False
            End If
            Return MyBase.CanInsertActivities(insertLocation, activitiesToInsert)
        End Function


        ' Properties
        Public Overrides ReadOnly Property CanExpandCollapse As Boolean
            Get
                Return False
            End Get
        End Property

    End Class
End Namespace

